const { ccclass, property } = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    onLoad() {
        //获取
        let money = GData.get("Money");
        console.warn("money", money);// 520

        //设置
        GData.set("Money", 100);
        console.warn("money", GData.get("Money"));// 100

        //改变1
        let change1 = GData.change("Money", -200); // 报错，改变不生效
        console.warn("money", change1);// 任然为 100
        //改变2
        let change2 = GData.change("Money", -50);
        console.warn("money", change2);// 50
        //改变3
        let change3 = GData.change("Money", -100, true);
        console.warn("money", change3);// -50
    }

}